<script language="javascript">
$(function(){
	$('form').form({ 
		success:function(data){
			var data = runJson(data);
			if(data.status == 0){
				alertText(data.info, 'error');
			}else{
				alertText(data.info, 'success', '{:U('Role/index')}');
			}
		}   
	}); 
});
</script>
<div class="wrapper clear">
	<div class="main">
    	<div class="toolbar">
			<a href="{:U('Role/index')}" class="btn">角色列表</a>
		</div>
		<div class="search">
            <div class="searchbox">
            	<h3><eq name='ACTION_NAME' value='edit'>编辑角色<else/>新增角色</eq></h3>
                <form action="<eq name='ACTION_NAME' value='edit'>{:U('Role/update')}<else />{:U('Role/insert')}</eq>&ajax=true" method="post">
                  <table class="tableform" cellpadding="0" cellspacing="0" style="width:900px;">
                    <tr>
                      <th>角色名称：</th>
                      <td><input type="text" value="{$vo.name}" id="name" name="name" style="width:200px;" class="easyui-validatebox input text" required="true" validType="length[2,20]" /></td>
                    </tr>
                    <tr>
                      <th>角色状态：</th>
                      <td><select name="status">
                          <option value="1" 
                          
                          <eq name="vo['status']" value="1">selected</eq>
                          >启用
                          
                          </option>
                          <option value="0" 
                          
                          <eq name="vo['status']" value="0">selected</eq>
                          >禁用
                          
                          </option>
                        </select></td>
                    </tr>
                    <tr>
                      <th>排序：</th>
                      <td><input type="text" class="input text" name="sort" id="sort" value="{$vo.sort}" style="width:100px;" /></td>
                    </tr>
                    <tr>
                      <th>备注：</th>
                      <td><textarea class="input textarea" name="remark" id="remark" style="width:300px; height:100px;">{$vo.remark}</textarea></td>
                    </tr>
                    <tr>
                      <th>&nbsp;
                        </td>
                      <td><eq name='ACTION_NAME' value='edit'>
                          <input type="hidden" name="id" value="{$vo.id}" />
                        </eq></td>
                    </tr>
                  </table>
                  <!--添加-->
                  <table align="center">
                    <tr>
                      <td align="center"><input class="submit" type="submit" value="保存" id="submits" onclick="return $('form').form('validate')" />
                        <input class="cancel" type="reset" value="取消" /></td>
                    </tr>
                  </table>
                  <!--end添加-->
                </form>
            
            </div>
		</div>
	</div>
</div>		
